GDK W32: Support smooth scrolling
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 7 Aug 2018 21:29:21 +0000 (21:29 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 18 Aug 2018 17:02:39 +0000 (17:02 +0000)
commitd64467b33475bf8358f66bec9450101f37c05e9c
tree3b639676bc871c9e1521ab8baa2aea08514ab2d2
parent099b967885d6ed0bd84cb3657311c470367fdee5
GDK W32: Support smooth scrolling

Set delta_x or delta_y for GdkScrollEvent.
HIWORD (wParam) in WM_MOUSE(H)WHEEL is the scroll delta.
A delta value of WHEEL_DELTA (which is 120) means scrolling
one full unit of something (for example, a line).

The delta should also be multiplied by the value that the
SystemParametersInfo (SPI_GETWHEELSCROLL(LINES|CHARS), 0, &value, 0)
call gives back, unless it gives back 0xffffffff, in which case
it indicates that scrolling is page- or screen-based, not line-based
(GDK doesn't support that at the moment).

Also, all deltas should be inverted, since MS sends negative deltas
when scrolling down (rotating the wheel back, in the direction of
the user).

With deltas set the mode should be set to GDK_SCROLL_SMOOTH.

Fixes issue 1263.
gdk/win32/gdkevents-win32.c